#!/usr/bin/env ansible-playbook
---
- hosts: localhost
  vars:
    ansible_ask_become_pass: true
    configs:
    - stylua

  tasks:
  - name: "Create symlink for configuration directories"
    ansible.builtin.file:
      src: "{{ playbook_dir }}/config/{{ item }}"
      dest: "~/.config/{{ item }}"
      state: link
      owner: 1000
      group: 1000
    loop: "{{ configs }}"

  - name: "Install pipx"
    community.general.pacman:
      name: python-pipx
      state: latest
    become: yes

  - name: "Install Virtualenv"
    community.general.pipx:
      name: virtualenv
      state: latest

  - name: "Install VirtualFish"
    community.general.pipx:
      name: virtualfish
      state: latest

  - name: "Install iPython"
    community.general.pipx:
      name: ipython
      state: latest

  - name: "Install Jupyterlab"
    community.general.pipx:
      name: jupyterlab
      state: latest

  - name: "Install Jupyterlab Vim"
    community.general.pipx:
      name: jupyterlab-vim
      state: latest
      install_deps: true

  - name: "Install Jupyter Client"
    community.general.pacman:
      name: python-jupyter-client
      state: latest
    become: yes

  - name: "Install Ueberzug"
    community.general.pacman:
      name: ueberzug
      state: latest
    become: yes

  - name: "Install Helm LS"
    kewlfft.aur.aur:
      name:
      - helm-ls
      state: latest
    become: yes
    become_user: aur_builder


  - name: "Install Cairosvg"
    community.general.pacman:
      name: python-cairosvg
      state: latest
    become: yes

  - name: "Install pnglatex"
    community.general.pipx:
      name: pnglatex
      state: latest

  - name: "Install Plotly"
    kewlfft.aur.aur:
      name: python-plotly
      state: latest
    become: yes
    become_user: aur_builder

  - name: "Install Kaleido"
    kewlfft.aur.aur:
      name: python-kaleido-bin
      state: latest
    become: yes
    become_user: aur_builder
        
  - name: "Rust"
    community.general.pacman:
      name: 
      - base-devel
      - rust
      state: latest
    become: yes

  - name: "Yay"
    kewlfft.aur.aur:
      name: yay # Yet another yogurt. Pacman wrapper and AUR helper written in go
      use: makepkg
      state: present
    become: yes
    become_user: aur_builder

  - name: "Paru"
    kewlfft.aur.aur:
      name: paru # Feature packed AUR helper
      state: latest
    become: yes
    become_user: aur_builder

  - name: "NPM"
    community.general.pacman:
      name: 
      - npm
      state: latest
    become: yes

  - name: "Install Node version manager"
    community.general.npm:
      name: n
      global: yes
      state: latest
    become: yes

  - name: "Install 'neovim' Node package"
    community.general.npm:
      name: neovim
      global: yes
      state: latest
    become: yes

  - name: "Install 'neovim' python package"
    community.general.pacman:
      name: 
      - python-pynvim
      state: latest
    become: yes

  - name: "Lua"
    community.general.pacman:
      name: 
      - lua # Powerful lightweight programming language designed for extending applications
      - luarocks # Deployment and management system for Lua modules
      state: latest
    become: yes

  - name: "Ruby"
    community.general.pacman:
      name: 
      - ruby # An object-oriented language for quick and easy programming
      state: latest
    become: yes

  - name: "Linters"
    community.general.pacman:
      name:
      - eslint # An AST-based pattern checker for JavaScript
      - flake8 # The modular source code checker
      - prettier # An opinionated code formatter for JS, JSON, CSS, YAML and much more
      - python-black # Uncompromising Python code formatter
      state: latest
    become: yes

  - name: "Linters from AUR"
    kewlfft.aur.aur:
      name:
      - stylua # Code formatter for Lua
      state: latest
    become: yes
    become_user: aur_builder

  - name: "Install Git BFG"
    kewlfft.aur.aur:
      name:
      - bfg # Removes large or troublesome blobs like git-filter-branch does, but faster.
      state: latest
    become: yes
    become_user: aur_builder

  - name: "Install Git Filter Repo"
    community.general.pacman:
      name:
      - git-filter-repo # Quickly rewrite git repository history (filter-branch replacement)
      state: latest
    become: yes

  - name: "Install Krew"
    kewlfft.aur.aur:
      name: krew # Krew is the package manager for kubectl plugins
      state: latest
    become: yes
    become_user: aur_builder

  - name: "Install Google Cloud CLI And Plugins"
    kewlfft.aur.aur:
      name:
      - google-cloud-cli # A set of command-line tools for the Google Cloud Platform. Includes gcloud (with beta and alpha commands), gsutil, and bq.
      - google-cloud-cli-gke-gcloud-auth-plugin # A google-cloud-sdk component that provides a kubectl authentication plugin for GKE.
      state: latest
    become: yes
    become_user: aur_builder

  - name: "Packer"
    community.general.pacman:
      name:
      - packer # tool for creating identical machine images for multiple platforms from a single source configuration
      state: latest
    become: yes

  - name: "Operator SDK"
    community.general.pacman:
      name: 
      - operator-sdk
      state: latest
    become: yes
...
